package bussinessService.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import utils.DateUtil;
import domain.vo.LogVO;
import domain.vo.queryObject;
import module.Logs;
import bussinessService.logsBussinessService;


/**
 * 
* @ClassName: LogsBussinessServiceImpl
* @Description: 日志业务层实现类
* @author chenchao
* @date 2013-10-31 上午07:30:34
*
 */
public class LogsBussinessServiceImpl implements logsBussinessService{


	@Override
	public void deleteT(int id) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getAll()
	 */
	public List<LogVO> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getById(java.lang.String)
	 */
	public Logs getById(String id) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#merageObject(java.lang.Object)
	 */
	public void merageObject(Logs log) throws SQLException {
		logsService.insertObject(log);
		
	}

	public int countByQueryObject(queryObject queryObject) throws SQLException {
		return logsService.countByQueryObject(queryObject);
	}

	public List<LogVO> getObjectByQueryObject(queryObject queryObject) throws SQLException {
			List<LogVO> vos = new ArrayList<LogVO>();
			List<Logs> result = new ArrayList<Logs>();
			result = logsService.getObjectByQueryObject(queryObject);
			for(Logs l : result) {
				LogVO vo = new LogVO();
				vo.setEmployeeName(l.getEmployeeName());
				vo.setLogContent(l.getLogContent());
				vo.setLogDate(DateUtil.data2String(l.getLogDate()));
				vos.add(vo);
			}
			
			return vos;
	}

}
